package com.cyz.test;

import java.sql.SQLException;
import java.util.List;

import org.junit.Ignore;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.cyz.dao.ProductDao;
import com.cyz.dao.impl.ProductDaoImpl;
import com.cyz.pojo.Product;

public class ProductTest11 {
	@Ignore
	public void productTest() {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
		Product p = (Product)ctx.getBean("product");
		System.out.println(p.getProductName());
	}
	@Ignore
	public void getProductByTypeName() throws SQLException {
		ProductDao p = new ProductDaoImpl();
		List<Product> list = p.getProductByTypeName("�ں�");
		System.out.println(list.get(0).getProductName());
	}
	@Ignore
	public void addType()//ok
	{
		ProductDao productdao=new ProductDaoImpl();
		productdao.addType("腮红");
		
	}
	@Ignore
	public void deleteType()//ok
	{
		ProductDao productdao=new ProductDaoImpl();
		productdao.deleteType("腮红");
		
	}
	@Ignore
	public void updateType()//ok
	{
		ProductDao productdao=new ProductDaoImpl();
		productdao.updateType("腮红", "高光");
		
	}
	@Ignore
	public void getTypeByName()//ok
	{
		ProductDao productdao=new ProductDaoImpl();
		System.out.println(productdao.getTypeByName("高光"));
		
	}
	@Ignore
	public void  getTypeIdByTypeName()//ok
	{
		ProductDao productdao=new ProductDaoImpl();
		System.out.println(productdao.getTypeIdByTypeName("高光"));
		
	}
	@Ignore
	public void deleteProduct()//ok
	{
		ProductDao productdao=new ProductDaoImpl();
		productdao.deleteProduct("405");
		
	}
}
